package com.ruoyi.system.domain.dto;

import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.utils.StringUtils;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;


/**
 * 主体基本信息对象 lv_business_license_info
 *
 * @author lvlian
 * @date 2024-07-24
 */
@Data
@ToString
public class BusinessLicenseInfo {

    private static final long serialVersionUID = 1L;

    /**
     * 编号
     */
    private String id;

    /**
     * 主体编号-编号规则中包含上类型
     */
    @Excel(name = "主体编号-编号规则中包含上类型")
    private String subjectNum;

    /**
     * 主体类型:自然人, 企业
     */
    @Excel(name = "主体类型:自然人, 企业")
    private String subjectType;

    /**
     * 主体角色（供应商、利废企业、再生资源企业)
     */
    @Excel(name = "主体角色", readConverterExp = "主体角色（供应商、利废企业、再生资源企业)")
    private String subjectRole;

    /**
     * 主体名称-企业名称&个体名称
     */
    @Excel(name = "主体名称-企业名称&个体名称")
    private String companyName;

    /**
     * 主体名称-企业名称&个体名称
     */
    @Excel(name = "主体名称-企业名称&个体名称")
    private String companyShortName;

    /**
     * 统一社会信用代码-税号
     */
    @Excel(name = "统一社会信用代码-税号")
    private String companyCode;

    /**
     * 企业类型行业类别
     * （工商类型）
     */

    private String companyType;

    /**
     * 注册资金
     */
    @Excel(name = "注册资金")
    private String registeredCapital;

    /**
     * 法人姓名
     */
    @Excel(name = "法人姓名")
    private String legalName;

    /**
     * 法人联系电话
     */
    @Excel(name = "法人联系电话")
    private String legalPhone;

    /**
     * 法人证件类型
     */
    @Excel(name = "法人证件类型")
    private String legalIdType;

    /**
     * 法人证件号
     */
    @Excel(name = "法人证件号")
    private String legalIdCard;

    /**
     * 成立日期
     */
    @Excel(name = "成立日期")
    private String registeredDate;

    /**
     * 经营范围
     */
    @Excel(name = "经营范围")
    private String businessScope;

    /**
     * 登记日期
     */
    @Excel(name = "登记日期")
    private String approvedDate;

    /**
     * 个体证件类型
     */
    @Excel(name = "个体证件类型")
    private String idType;

    /**
     * 个体证件号码
     */
    @Excel(name = "个体证件号码")
    private String idNum;

    /**
     * 营业执照有效期
     */

    private String expiryDate;

    /**
     * 现居地址
     */
    @Excel(name = "现居地址")
    private String address;

    /**
     * 登记机关发证机关
     */
    private String agency;

    /**
     * 注册地址（企业）&户籍地址（自然人）
     */
    @Excel(name = "注册地址", readConverterExp = "企=业")
    private String registeredAddr;

    /**
     * 联系人电话
     */
    @Excel(name = "联系人电话")
    private String contactPersonPhone;

    /**
     * 联系人
     */
    @Excel(name = "联系人")
    private String contactPerson;

    /**
     * 开户银行
     */
    @Excel(name = "开户银行")
    private String openBank;

    /**
     * 银行账户
     */
    @Excel(name = "银行账户")
    private String bankAccno;

    /**
     * 认证状态 1 已认证 2 待认证 3 认证中 4认证失败
     */
    @Excel(name = "认证状态 1 已认证 2 待认证 3 认证中 4认证失败")
    private String rzStatus;

    /**
     * 行政区划代码
     */
    @Excel(name = "行政区划代码")
    private String xzqhCode;

    /**
     * 业务负责人名称
     */
    @Excel(name = "业务负责人名称")
    private String salePersonName;

    /**
     * 业务负责人联系方式
     */
    @Excel(name = "业务负责人联系方式")
    private String salePersonPhone;

    /**
     * 当前状态（如运营中、停业等）
     */
    @Excel(name = "当前状态", readConverterExp = "如=运营中、停业等")
    private String companyStatus;

    /**
     * 营业执照照片
     */
    @Excel(name = "营业执照照片")
    private String companyImg;

    /**
     * 录入人
     */
    @Excel(name = "录入人")
    private String createUser;

    /**
     * 录入日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "录入日期", width = 30, dateFormat = "yyyy-MM-dd")
    private String createDate;

    /**
     * 所属公司编码
     */
    @Excel(name = "所属公司编码")
    private String orgCode;

    /**
     * 天眼评分
     */
    @Excel(name = "天眼评分")
    private Integer tianyanScore;

    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public void setSubjectNum(String subjectNum) {
        this.subjectNum = subjectNum;
    }

    public String getSubjectNum() {
        return subjectNum;
    }

    public void setSubjectType(String subjectType) {
        this.subjectType = subjectType;
    }

    public String getSubjectType() {
        return subjectType;
    }

    public void setSubjectRole(String subjectRole) {
        this.subjectRole = subjectRole;
    }

    public String getSubjectRole() {
        return subjectRole;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyShortName(String companyShortName) {
        this.companyShortName = companyShortName;
    }

    public String getCompanyShortName() {
        return companyShortName;
    }

    public void setCompanyCode(String companyCode) {
        this.companyCode = companyCode;
    }

    public String getCompanyCode() {
        return companyCode;
    }

    public void setCompanyType(String companyType) {
        this.companyType = companyType;
    }

    public String getCompanyType() {
        return companyType;
    }

    public void setRegisteredCapital(String registeredCapital) {
        this.registeredCapital = registeredCapital;
    }

    public String getRegisteredCapital() {
        return registeredCapital;
    }

    public void setLegalName(String legalName) {
        this.legalName = legalName;
    }

    public String getLegalName() {
        return legalName;
    }

    public void setLegalPhone(String legalPhone) {
        this.legalPhone = legalPhone;
    }

    public String getLegalPhone() {
        return legalPhone;
    }

    public void setLegalIdType(String legalIdType) {
        this.legalIdType = legalIdType;
    }

    public String getLegalIdType() {
        return legalIdType;
    }

    public void setLegalIdCard(String legalIdCard) {
        this.legalIdCard = legalIdCard;
    }

    public String getLegalIdCard() {
        return legalIdCard;
    }

    public void setRegisteredDate(String registeredDate) {
        this.registeredDate = registeredDate;
    }

    public String getRegisteredDate() {
        return registeredDate;
    }

    public void setBusinessScope(String businessScope) {
        this.businessScope = businessScope;
    }

    public String getBusinessScope() {
        return businessScope;
    }

    public void setApprovedDate(String approvedDate) {
        this.approvedDate = approvedDate;
    }

    public String getApprovedDate() {
        return approvedDate;
    }

    public void setIdType(String idType) {
        this.idType = idType;
    }

    public String getIdType() {
        return idType;
    }

    public void setIdNum(String idNum) {
        this.idNum = idNum;
    }

    public String getIdNum() {
        return idNum;
    }

    public void setExpiryDate(String expiryDate) {
        this.expiryDate = expiryDate;
    }

    public String getExpiryDate() {
        return expiryDate;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getAddress() {
        return address;
    }

    public void setAgency(String agency) {
        this.agency = agency;
    }

    public String getAgency() {
        return agency;
    }

    public void setRegisteredAddr(String registeredAddr) {
        this.registeredAddr = registeredAddr;
    }

    public String getRegisteredAddr() {
        return registeredAddr;
    }

    public void setContactPersonPhone(String contactPersonPhone) {
        this.contactPersonPhone = contactPersonPhone;
    }

    public String getContactPersonPhone() {
        return contactPersonPhone;
    }

    public void setContactPerson(String contactPerson) {
        this.contactPerson = contactPerson;
    }

    public String getContactPerson() {
        return contactPerson;
    }

    public void setOpenBank(String openBank) {
        this.openBank = openBank;
    }

    public String getOpenBank() {
        return openBank;
    }

    public void setBankAccno(String bankAccno) {
        this.bankAccno = bankAccno;
    }

    public String getBankAccno() {
        return bankAccno;
    }

    public void setRzStatus(String rzStatus) {
        this.rzStatus = rzStatus;
    }

    public String getRzStatus() {
        return rzStatus;
    }

    public void setXzqhCode(String xzqhCode) {
        this.xzqhCode = xzqhCode;
    }

    public String getXzqhCode() {
        return xzqhCode;
    }

    public void setSalePersonName(String salePersonName) {
        this.salePersonName = salePersonName;
    }

    public String getSalePersonName() {
        return salePersonName;
    }

    public void setSalePersonPhone(String salePersonPhone) {
        this.salePersonPhone = salePersonPhone;
    }

    public String getSalePersonPhone() {
        return salePersonPhone;
    }

    public void setCompanyStatus(String companyStatus) {
        this.companyStatus = companyStatus;
    }

    public String getCompanyStatus() {
        return companyStatus;
    }

    public void setCompanyImg(String companyImg) {
        this.companyImg = companyImg;
    }


    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }

    public String getCreateDate() {
        return createDate;
    }

    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }

    public String getOrgCode() {
        return orgCode;
    }

    public void setTianyanScore(Integer tianyanScore) {
        this.tianyanScore = tianyanScore;
    }

    public Integer getTianyanScore() {
        return tianyanScore;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("subjectNum", getSubjectNum())
                .append("subjectType", getSubjectType())
                .append("subjectRole", getSubjectRole())
                .append("companyName", getCompanyName())
                .append("companyShortName", getCompanyShortName())
                .append("companyCode", getCompanyCode())
                .append("companyType", getCompanyType())
                .append("registeredCapital", getRegisteredCapital())
                .append("legalName", getLegalName())
                .append("legalPhone", getLegalPhone())
                .append("legalIdType", getLegalIdType())
                .append("legalIdCard", getLegalIdCard())
                .append("registeredDate", getRegisteredDate())
                .append("businessScope", getBusinessScope())
                .append("approvedDate", getApprovedDate())
                .append("idType", getIdType())
                .append("idNum", getIdNum())
                .append("expiryDate", getExpiryDate())
                .append("address", getAddress())
                .append("agency", getAgency())
                .append("registeredAddr", getRegisteredAddr())
                .append("contactPersonPhone", getContactPersonPhone())
                .append("contactPerson", getContactPerson())
                .append("openBank", getOpenBank())
                .append("bankAccno", getBankAccno())
                .append("rzStatus", getRzStatus())
                .append("xzqhCode", getXzqhCode())
                .append("salePersonName", getSalePersonName())
                .append("salePersonPhone", getSalePersonPhone())
                .append("companyStatus", getCompanyStatus())
                .append("companyImg", getCompanyImg())
                .append("createUser", getCreateUser())
                .append("createDate", getCreateDate())
                .append("orgCode", getOrgCode())
                .append("tianyanScore", getTianyanScore())
                .toString();
    }

    public String getCompanyImg() {
        if (StringUtils.isNotEmpty(companyImg) &&  !companyImg.contains( "http") ) {

            return "https://data.lvlianhengsheng.com/dev-api/file/fileAttachmentInfo/viewImage?key=" + companyImg;
        }
        return companyImg;
    }
}
